package com.xunce.xcworkservice.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.sql.Date;
import java.sql.Timestamp;
import java.time.LocalDateTime;

/**
 * @author yanlong.guo
 * 用户登录token授权表
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Table(name = "accountToken")
public class AccountToken {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "user_id")
    private Integer userId;

    @TableField(value = "name")
    private String name;

    @TableField(value = "token")
    private String token;

    @TableField(value = "abilities")
    private String abilities;

    @TableField(value = "expire_time")
    private LocalDateTime expireTime;

    @TableField(value = "last_used_at")
    private LocalDateTime lastUsedAt;

    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}
